import request from '@/utils/request'

export function sign(code,state) {
  return request({
    url: `api/mp/sign?code=${code}&state=${state}`,
    method: 'get'
  })
}

export function jump() {
  return request({
    url: 'api/mp',
    method: 'get'
  })
}

export function getConfig(url) {
  return request({
    url: 'api/mp/getConfig?url=' + url,
    method: 'get'
  })
}

export function queryOrder(tradeNo) {
  return request({
    url: 'api/mp/queryOrder?outTradeNo=' + tradeNo,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/mp',
    method: 'post',
    data
  })
}

export default { sign, jump, getConfig, queryOrder, add }
